<?php
namespace Modules\Admin\Http\Controllers;

use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Modules\Admin\Entities\Module;
use Modules\Admin\Http\Requests\ModuleRequest;
use Modules\Admin\Service\ModuleService;

class ModuleController extends Controller
{
    //显示列表
    public function index()
    {
        $data = Module::paginate(10);
        return view('admin::module.index', compact('data'));
    }
    public function updateCache(ModuleService $moduleService){

         $moduleService->updateCache();
         //设置闪存并返回
        session()->flash('success','更新模块成功！');
        return back();
    }
    public function setDefaultModule(Module $module){
       $module->setDfaulet();
       //设置闪存并返回
       session()->flash('success','设置默认模块成功！');
       return back();
    }
}
